/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4 -*- */
/* vi: set expandtab shiftwidth=4 tabstop=4: */

#include <stdint.h>
#include "XorHashMacro.h"

extern const uint32_t hashwords[];

/** \brief hash based on 2 16-bit memory lookups
 *
 * Author: Nick Galbreath  nickg [at] modp [dot] com
 * License: Public domain
 */
class NGalbreathHash32_random16  {
public:
    uint32_t hash32(uint32_t n) const
    {
        return hashwords[n         & 0xffffu]
            +  hashwords[(n >> 16) & 0xffffu];
    }

    const char* name() const
    {
        return "NickGalbreath_random16";
    }

    XORHASH
};
